home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 January / Ahoy_Magazine_86-01_1986_Double_L.d64 / martian monster (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  8.4 KB  |  288 lines

  1. 2 rem the martian monsters
  2. 3 rem by j.c.hilty
  3. 5 poke 52,48:poke 56,48
  4. 10 s=54272:forl=stos+24:pokel,0:next
  5. 40 v=53248
  6. 200 print"[147]":poke 53280,0:poke 53281,0
  7. 220 print"[159]t h e   m a r t i a n   m o n s t e r s"
  8. 230 print
  9. 240 print tab(14)" [146]       "
  10. 250 print tab(15)" [146]     "
  11. 260 print tab(9)" [146]  [146]     [146]   "
  12. 270 print tab(9)"   [146]         [146]       "
  13. 280 print tab(10)" [146]           [146]     "
  14. 290 print tab(10)"       [146]  [146]        "
  15. 300 print tab(13)"          [146]     "
  16. 310 print tab(14)"        "
  17. 320 print tab(15)"      "
  18. 330 print tab(16)" [146]    "
  19. 340 print tab(16)" [146]    "
  20. 350 print tab(15)"   [146]    "
  21. 360 print
  22. 370 print tab(2)"[159]...spaceships are our favorite food..."
  23. 380 print
  24. 390 print tab(4)"...and we are getting hungry..."
  25. 405 poke s+24,15:poke s+1,15:poke s+5,16:poke s+6,240:poke s+4,21
  26. 420 for t=1 to 3
  27. 425 r=10
  28. 430 poke s+15,r
  29. 450 r=r+1:if r=200 then 470
  30. 460 goto 430
  31. 470 next t
  32. 480 for i=0 to 24:poke s+i,0:next
  33. 520 print"[147]":print""tab(4)"please wait for one moment..."
  34. 521 print:print"..while we work up an appetite for you.."
  35. 525 for x=50880 to 51116:read a:poke x,a:next
  36. 530 for x=49152 to 49528:read a:poke x,a:next
  37. 535 for x=12288 to 12671:read a:poke x,a:next
  38. 540 poke 49522,1:poke 49523,0:poke 49524,30:poke 49525,0:poke 49526,23
  39. 554 print"[147]"
  40. 555 for p=0 to 18
  41. 560 t$="":for i=0 to 30:t=32
  42. 570 if int(rnd(2)*7)<1 then t=46:if int(rnd(2)*5)<1 then t=42
  43. 580 t$=t$+chr$(t):next i
  44. 590 t$=t$+chr$(170)
  45. 600 print t$
  46. 610 next p
  47. 620 print"  [223][146]         [169] [223][146] [169] [223][146]           [169]"
  48. 630 print"    [223][146]  [169] [223][169]           [223][146] [169] [223][146] [169]  "
  49. 640 print"                               "
  50. 650 print"                               "
  51. 652 print"":print tab(34)"the"
  52. 653 print tab(32)"martian"
  53. 654 print tab(32)"monsters"
  54. 655 print"":printtab(33)"score"
  55. 656 print:print:print tab(33)"ships"
  56. 660 print:print:print tab(33)"missed":print tab(33)"shots"
  57. 662 sc=0:sh=5:ms=0
  58. 665 print"":print""tab(34)sh
  59. 666 print"":print""tab(34)sc
  60. 667 print"":print""tab(34)ms
  61. 669 rem prepare sprites
  62. 672 poke 2040,193:poke 2041,194
  63. 674 for t=2042 to 2046
  64. 675 poke t,192
  65. 676 next t
  66. 680 poke v+39,1:poke v+40,10:poke v+41,5:poke v+42,4
  67. 685 poke v+28,1:poke v+37,6:poke v+38,2
  68. 690 poke v+43,7:poke v+44,8:poke v+45,6
  69. 700 x0=140:y0=160
  70. 710 poke v+0,x0:poke v+1,y0
  71. 720 poke v+4,35:poke v+5,60
  72. 730 poke v+6,85:poke v+7,60
  73. 740 poke v+8,135:poke v+9,60
  74. 750 poke v+10,185:poke v+11,60
  75. 760 poke v+12,235:poke v+13,60
  76. 765 poke v+21,125
  77. 770 poke 50437,0:poke 50438,255
  78. 780 poke 50439,0:poke 50440,2
  79. 790 poke 50441,0:poke 50442,254
  80. 800 poke 50443,0:poke 50444,1
  81. 810 poke 50445,0:poke 50446,253
  82. 815 poke 50435,0:poke 50436,255
  83. 820 poke 50432,124
  84. 830 sys 51104
  85. 840 rem main loop
  86. 850 poke v+0,x0:poke v+1,y0
  87. 860 x0=x0+5:if x0>250 then x0=30
  88. 870 jy=peek(56321)and15
  89. 880 if jy=13theny0=y0+4:if y0>205 then y0=205
  90. 890 if jy=14 then y0=y0-4:if y0<70 then y0=70
  91. 900 fb=-((peek(56321)and16)=0):if fb=1 then 2000
  92. 910 w=peek(v+30)
  93. 920 if w=5 then q=2042:goto 3000
  94. 930 if w=9 then q=2043:goto 3000
  95. 940 if w=17 then q=2044:goto 3000
  96. 950 if w=33 then q=2045:goto 3000
  97. 960 if w=65 then q=2046:goto 3000
  98. 965 sys 49152
  99. 970 goto 850
  100. 2000 rem fire laser
  101. 2005 poke 50432,0
  102. 2010 poke v+2,x0:poke v+3,y0-12
  103. 2015 poke v+21,127
  104. 2020 poke 50432,2
  105. 2030 if peek(v+3)<55 then 2500
  106. 2035 w1=peek(v+30)
  107. 2040 if w1=6 then q=2042:goto 2600
  108. 2050 if w1=10 then q=2043:goto 2600
  109. 2060 if w1=18 then q=2044:goto 2600
  110. 2070 if w1=34 then q=2045:goto 2600
  111. 2080 if w1=66 then q=2046:goto 2600
  112. 2090 goto 2030
  113. 2499 rem missed shot
  114. 2500 ms=ms+1
  115. 2505 print"":print""tab(34)ms
  116. 2510 poke v+21,125
  117. 2530 poke v+23,124:poke v+29,124
  118. 2531 p=195
  119. 2532 for t=1 to 8
  120. 2533 for z=2042 to 2046
  121. 2534 poke z,p
  122. 2535 next z
  123. 2536 p=p+1:if p=197 then p=195
  124. 2537 poke s+5,9:poke s+6,0:poke s+24,15
  125. 2538 poke s+1,80:poke s,15:poke s+4,33
  126. 2539 for e=0 to 50:next e
  127. 2540 poke s+4,32
  128. 2541 next t
  129. 2542 w1=peek(v+30)
  130. 2543 for z=2042 to 2046:poke z,192:next
  131. 2544 poke v+23,0:poke v+29,0
  132. 2545 poke 50432,124
  133. 2548 if ms=5 then 7000
  134. 2550 goto 850
  135. 2599 rem laser hits martian
  136. 2600 sc=sc+100
  137. 2602 print"":print""tab(33)sc
  138. 2605 poke v+21,125
  139. 2606 poke q,197
  140. 2608 gosub 3500
  141. 2630 for i=0 to 24:poke s+i,0:next
  142. 2631 poke s+24,15:poke s+1,15:poke s+5,16
  143. 2632 poke s+6,240:poke s+4,21
  144. 2633 r=80
  145. 2634 poke s+15,r
  146. 2635 r=r+1:if r=160 then 2640
  147. 2636 goto 2634
  148. 2640 for i=0 to 24:poke s+i,0:next
  149. 2642 poke q,192
  150. 2650 w1=peek(v+30)
  151. 2655 poke 50432,124
  152. 2660 goto 850
  153. 3000 rem martian eats spaceship
  154. 3005 poke 50432,0
  155. 3010 if q=2042 then poke v+29,4:poke v+23,4
  156. 3020 if q=2043 then poke v+29,8:poke v+23,8
  157. 3030 if q=2044 then poke v+29,16:poke v+23,16
  158. 3040 if q=2045 then poke v+29,32:poke v+23,32
  159. 3050 if q=2046 then poke v+29,64:poke v+23,64
  160. 3060 poke 2040,197
  161. 3070 gosub 3500
  162. 3080 poke v+21,124
  163. 3090 p=195
  164. 3100 for i=0 to 24:poke s+i,0:next
  165. 3110 poke s+5,9:poke s+6,0:poke s+24,15
  166. 3120 for t=1 to 8
  167. 3130 poke q,p
  168. 3140 p=p+1:if p=197 then p=195
  169. 3150 poke s+1,80:poke s,15:poke s+4,33
  170. 3160 for e=0 to 50:next e
  171. 3170 poke s+4,32
  172. 3180 next t
  173. 3190 sh=sh-1
  174. 3195 print"":print""tab(34)sh
  175. 3200 poke 2040,193
  176. 3210 poke q,192
  177. 3212 poke v+29,0:poke v+23,0
  178. 3215 x0=160:y0=140
  179. 3220 poke v+0,x0:poke v+1,y0
  180. 3230 poke v+21,125
  181. 3240 poke v+8,135:poke v+9,60
  182. 3260 poke 50432,124
  183. 3265 w=peek(v+30)
  184. 3268 if sh=0 then 7000
  185. 3270 goto 965
  186. 3499 rem explosion sound
  187. 3500 for i=0 to 24:poke s+i,0:next
  188. 3510 poke s+24,15:poke s+12,160:poke s+13,252
  189. 3520 poke s+8,80:poke s+7,40:poke s+11,129
  190. 3530 for t=0 to 100:next
  191. 3540 poke s+11,128
  192. 3550 return
  193. 4000 rem ml sprite routine
  194. 4010 data 169,255,45,0,198,240,16,169,0,141,0,198,162,21,189,0
  195. 4020 data 197,157,0,198,202,208,247,162,1,169,1,141,80,197,173,80
  196. 4030 data 197,45,0,197,240,3,76,243,198,232,232,14,80,197,208,238
  197. 4040 data 76,49,234,169,0,29,0,197,208,3,76,97,199,169,128,61
  198. 4050 data 0,197,240,48,254,0,198,208,40,222,255,207,76,144,199,80
  199. 4060 data 197,45,16,208,208,12,173,16,208,13,80,197,141,16,208,76
  200. 4070 data 43,199,173,16,208,77,80,197,141,16,208,189,0,197,157,0
  201. 4080 data 198,76,97,199,222,0,198,208,40,254,255,207,208,29,173,80
  202. 4090 data 197,45,16,208,208,12,173,16,208,13,80,197,141,16,208,76
  203. 4100 data 91,199,173,16,208,77,80,197,141,16,208,189,0,197,157,0
  204. 4110 data 198,169,0,232,29,0,197,208,3,76,140,199,169,128,61,0
  205. 4120 data 197,240,11,254,0,198,208,20,222,255,207,76,134,199,222,0
  206. 4130 data 198,208,9,254,255,207,189,0,197,157,0,198,202,76,233,198
  207. 4140 data 169,255,221,255,207,240,3,76,43,199,173,80,197,76,17,199
  208. 4150 data 120,169,192,141,20,3,169,198,141,21,3,88,96
  209. 5000 rem scroll data
  210. 5010 data 174,114,193,224,3,144,3,76,117,192,188,114,193,140,121,193,174
  211. 5020 data 118,193,232,202,32,30,193,172,121,193,173,119,193,201,2,208,10
  212. 5030 data 169,32,72,173,33,208,72,76,50,192,177,90,72,177,92,72,204
  213. 5040 data 116,193,240,20,200,177,90,72,177,92,136,145,92,104,145,90,200
  214. 5050 data 204,116,193,208,238,240,18,136,177,90,72,177,92,200,145,92,104
  215. 5060 data 145,90,136,204,115,193,208,238,173,119,193,201,0,208,5,104,104
  216. 5070 data 76,111,192,104,145,92,104,145,90,236,117,193,208,160,96,172,116
  217. 5080 data 193,200,189,114,193,170,32,30,193,173,120,193,201,2,208,19,136
  218. 5090 data 169,32,153,122,193,173,33,208,153,162,193,204,115,193,208,239,240
  219. 5100 data16,136,177,90,153,122,193,177,92,153,162,193,204,115,193,208,240
  220. 5110 data 236,117,193,240,37,202,32,30,193,172,116,193,200,136,177,90,72
  221. 5120 data 177,92,32,48,193,145,92,104,145,90,32,56,193,204,115,193,208
  222. 5130 data 234,236,117,193,208,221,240,46,202,206,118,193,232,32,30,193,172
  223. 5140 data 116,193,200,136,32,48,193,177,90,72,177,92,32,56,193,145,92
  224. 5150 data 104,145,90,204,115,193,208,234,236,118,193,208,221,238,118,193,232
  225. 5160 data 32,30,193,173,120,193,201,0,240,20,172,115,193,136,200,185,162
  226. 5170 data 193,145,92,185,122,193,145,90,204,116,193,208,240,96,189,89,193
  227. 5180 data 133,91,24,105,212,133,93,189,64,193,133,90,133,92,96,72,152
  228. 5190 data 24,105,40,168,104,96,72,152,56,233,40,168,104,96,0,40,80
  229. 5200 data 120,160,200,240,24,64,104,144,184,224,8,48,88,128,168,208,248
  230. 5210 data 32,72,112,152,192,4,4,4,4,4,4,4,5,5,5,5,5
  231. 5220 data 5,6,6,6,6,6,6,6,7,7,7,7,7,3,0,4,0
  232. 5230 data 4,1,1
  233. 5232 rem monster data
  234. 5235 data 6,0,96,3,0,192,1,129,128,0,195,0,0,126,0,0,255,0
  235. 5240 data 1,255,128,3,255,192,227,255,199,63,221
  236. 5244 data 252,227,255,199,3,255,192,1,255,128
  237. 5248 data 0,255,0,0,66,0,0,66,0,0,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  238. 5250 rem rocket multicolor data
  239. 5260 data 0,32,0,0,32,0,0,32,0,0,168,0,0,168,0,1,169,0,5,169,64
  240. 5270 data 21,169,80,85,169,84,0,168,0,0,168,0,0,168,0,0,168,0,3,255,0
  241. 5280 data 15,255,192,63,255,240,15,255,192,0,48,0,0,0,0,0,0,0,0,0,0,0
  242. 5290 rem laser data
  243. 5300 data 0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0
  244. 5310 data 0,56,0,0,56,0,0,56,0,0,56,0,0,56,0
  245. 5320 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  246. 5330 rem gobble data
  247. 5340 data 3,0,0,1,128,0,0,192,0,0,60,0,0,126,0,0,255,0,1,247,224
  248. 5350 data 1,255,224,1,252,0,1,248,0,0,248,0,0,120,0,0,60,0
  249. 5360 data 0,39,192,0,35,192,0,32,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  250. 5370 rem more gobble data
  251. 5380 data 3,0,0,1,128,0,0,192,0,0,60,0,0,126,0,0,255,0,1,247,128
  252. 5390 data 1,255,192,1,255,192,1,255,192,0,255,192,0,127,128,0,62,0
  253. 5400 data 0,32,0,0,32,0,0,32,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  254. 5410 rem explosion
  255. 5420 data 0,0,0,76,1,0,0,128,4,32,4,32,0,48,0,8,0,0,0,32,48,80,0,130
  256. 5430 data 3,12,0,0,0,4,32,0,128,0,36,0,0,0,192,201,0,4,0,0,0,19,32,192
  257. 5440 data 0,4,0,32,0,1,4,192,0,0,4,8,0,0,0,0
  258. 6999 rem game over-play again option
  259. 7000 print"[147]"
  260. 7010 poke v+21,124
  261. 7020 print""tab(6)"yummy..."
  262. 7030 print tab(14)"yummy..."
  263. 7040 print tab(22)"yummy..."
  264. 7050 print:print tab(4)"we got spaceships in our tummy!!!!"
  265. 7060 for i=0 to 24:poke s+i,0:next
  266. 7070 poke s+24,15:poke s+1,15:poke s+5,16
  267. 7080 poke s+6,240:poke s+4,21
  268. 7090 for t=1 to 2
  269. 7100 r=10
  270. 7110 poke s+15,r
  271. 7120 r=r+1
  272. 7130 if r=200 then 7150
  273. 7140 goto 7110
  274. 7150 next t
  275. 7160 for i=0 to 24:poke s+i,0:next
  276. 7170 print"[147]"
  277. 7190 print ""tab(9)"s c o r e     "sc
  278. 7200 print:print
  279. 7210 print tab(6)"play again?      y or n"
  280. 7215 get junk$:if junk$<>"" then 7215
  281. 7220 get a$:if a$="" then 7220
  282. 7230 if a$="y" then 7250
  283. 7240 end
  284. 7250 poke v+21,0:poke 50432,0
  285. 7260 print"[147]"
  286. 7265 w=peek(v+30)
  287. 7270 run
  288.